import request from '@/utils/request'
// 获取部门列表
export function getDepartmentInfo() {
  return request({
    url: '/company/department'
  })
}
// s删除部门
export function delDepartmentInfo(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}

export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
/**
 * 根据id获取部门
 * @param {*} id 部门id
 * @returns
 */
export function getDepartmentInfoById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'get'
  })
}

/**
 * 根据id进行部门编辑
 * @param {*} data  编辑部门的对象参数
 * @returns
 */
export function editDepartmentById(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}
